package pub.developers.forum.domain.repository;

import pub.developers.forum.api.model.PageRequestModel;
import pub.developers.forum.domain.entity.BasePosts;

import java.util.Date;
import java.util.List;
import java.util.Set;


public interface PostsRepository {


    BasePosts get(Long id);

    List<BasePosts> queryInIds(Set<Long> postsIds);

    List<Long> getAllIdByAuthorId(Long authorId);

    void increaseComments(Long id, Date updateAt);

    void decreaseComments(Long id, Date updateAt);

    void increaseViews(Long id, Date updateAt);

    void increaseApproval(Long id, Date updateAt);

    void decreaseApproval(Long id, Date updateAt);

    void delete(Long id);

    void softDelete(Long id,Date update);


    void update(BasePosts basePosts);

    //根据登录用户的id 拿到该用户发表的帖子的id
    Long[] getPostsId(Long id);

    Long[] getPostsId(Long id,PageRequestModel pageRequestModel);

    Long[] getPostsId(PageRequestModel pageRequestModel);

    Long[] getBanPostsId(PageRequestModel pageRequestModel);

    Long[] getReportedPostsId(PageRequestModel pageRequestModel);

    //根据帖子id 拿到帖子信息
    BasePosts getPostInformation(Long postId);

    Long[] getFilterPosts(PageRequestModel pageRequestModel);

    // 获取所有帖子
    List<BasePosts> getAllPost();

    void deleteByAuthorId (Long authorId);

    Long getFilterTotal(PageRequestModel pageRequestModel); //获取被过滤的帖子的总数
}
